<include file="public@header"/>
<style>
    table{ border:1px solid #000; width:80%; font-size:1rem; margin-bottom:20px}
    td{border:1px solid #000; padding:0 5px; height:2rem; text-align:center}
    .form-control{
        /*width:auto !important; */
        width: 100%;
        display:inline-block;
    }
</style>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('orders/visua')}">{:lang('可视化墓区')}</a></li>
        <li><a href="{:url('Deposit/tomb_deposit')}?order_id={$order_id}">格位信息</a></li>
        <li><a href="{:url('Deposit/deposit_applyer')}?order_id={$order_id}">寄存人信息</a></li>
        <li><a href="{:url('Deposit/deposit_user')}?order_id={$order_id}">逝者信息</a></li>
        <li class="active"><a href="">合同签订</a></li>
    </ul>
    <form class="form-horizontal js-ajax-form" action="{:url('Deposit/signcontract')}" method="post" enctype="multipart/form-data" style="width:25%; float:left;">
        <fieldset>
            <h4>基本信息</h4>
            <input type="hidden" name="order_id" value="{$order_id}">
            <div class="form-group">
                <label class="control-label">合同备案号</label>
                <div class="controls">
                    <input type="hidden" id="order_id" name="order_id"  value="{$order_id}"  >
                    <input type="hidden" id="contract_sn" name="contract_sn"  value="{$contract_sn}"  >
                    <input type="hidden" name="contract_file"   value="{$json_file}"  >
                    <input type="text"  disabled class="form-control" value="{$contract_sn}"  >
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">合同签订日期</label>
                <div class="controls">
                    <input type="text" id="sign_time" name="sign_time" class="sign_time form-control js-date" value="{$sign_time}"  autocomplete="off">
                </div>
            </div>
            <div class="form-group" style="display:none;">
                <label class="control-label">合同备案日期</label>
                <div class="controls">
                    <input type="text" name="keep_record_time" class=" form-control js-date" value="{$add_order_time}"  autocomplete="off">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">上传签章合同</label>
                <div class="controls">
                    <input type="text" name="contract_enclosure"  style="width: 80%;"  id="contract_enclosure-name" class="form-control" value="{$result.contract_enclosure_file_name}" readonly/>
                    <input type="hidden" name="contract_enclosure" id="contract_enclosure" value="{$result.contract_enclosure|default=''}" />
                    <input type="hidden" name="contract_enclosure_file_id" id="contract_enclosure-file_id"  value="{$result.contract_enclosure_file_id|default=''}"  />
                    <a class="btn btn-primary upload" href="javascript:gpyUploadOneImage('上传签章合同','#contract_enclosure','{$tomb_num}','file','{$contract_sn}');">{:lang("UPLOAD")}</a>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label">上传合同附件</label>
                <div class="controls">
                    <input type="text" name="supplement" id="supplement-name"   style="width: 80%;"  class="form-control" value="{$result.supplement_file_name}" readonly />
                    <input type="hidden" name="supplement" id="supplement"  value="{$result.supplement|default=''}"  />
                    <input type="hidden" name="supplement_file_id" id="supplement-file_id"  value="{$result.supplement_file_id|default=''}"  />
                    <a class="btn btn-primary upload" href="javascript:gpyUploadOneImage('上传合同附件','#supplement','{$tomb_num}','file','{$contract_sn}');">{:lang("UPLOAD")}</a>
                </div>
            </div>
            <div class="form-group">
                <div  style="margin-left: 100px;color: red;">
                    <p> 提示： 本页面需要点击两次保存按钮：</p>
                    <p>1 填写合同签订日期后需要保存，再打印合同内容；</p>
                    <p>2 上传签章合同后也需要保存，然后点击下一步。</p>
                </div>
            </div>
        </fieldset>
        <div class="form-actions" style="padding-left: 80px;">
            <button type="submit" class="btn btn-primary js-ajax-submit">保存</button>
            <a class="btn btn-default" id="xyb" data-href="{:url('Orderpay')}?order_id={$order_id}&customer_id={$customer_id}">下一步</a>
        </div>
    </form>
    <div style="width:68%; float:left; margin-left:3%">
        <iframe id="contract" src='https://view.officeapps.live.com/op/view.aspx?src={$file_docx}' width='100%' height='100%' frameborder='1' style="width:100%; min-height:500px; max-height:800px;"></iframe>
<!--        <iframe id="contract" src='{$file_html}' width='100%' height='100%' frameborder='1' style="width:100%; min-height:500px; max-height:800px;"></iframe>-->
        <!--                <iframe id="contract" src='http://127.0.0.1:6701/temp/doc/JZ-370126-2020-053016-ys1002.htm' width='100%' height='100%' frameborder='1' style="width:100%; min-height:500px; max-height:800px;"></iframe>-->
        <!--                <iframe id="contract" src='https://view.officeapps.live.com/op/view.aspx?src=http://jiance.zkjysw.com/data/upload/user/20200218/5e4b92cb8bfbf.docx' width='100%' height='100%' frameborder='1' style="width:100%; min-height:500px; max-height:800px;"></iframe>-->
    </div>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js?={:time()}"></script>

<script type="text/javascript">
    // 提交订单
    $("#xyb").click(function(){
        var url = $(this).attr('data-href');
        $.getJSON(url+'&ajax=1').done(function (data) {
            if(data.code==0){
                layer.msg(data.msg);
            }else {
                window.location.href =url;
            }
        })
    });
</script>

</body>
</html>